package com.example.communicate;

import java.util.ArrayList;
import java.util.List;

public class OfflineMessageManager {
    private List<String> offlineMessages;

    // 构造方法，初始化离线消息列表
    public OfflineMessageManager() {
        offlineMessages = new ArrayList<>();
    }

    // 存储离线消息
    public void storeOfflineMessage(String message) {
        offlineMessages.add(message);
        System.out.println("存储离线消息：" + message);
    }

    // 获取所有离线消息
    public List<String> getOfflineMessages() {
        return new ArrayList<>(offlineMessages);
    }

    // 清除所有离线消息
    public void clearOfflineMessages() {
        offlineMessages.clear();
        System.out.println("所有离线消息已清除");
    }
}
